home *** CD-ROM | disk | FTP | other *** search
- /* -----------------------------------
- Define the maximum depth we will
- allow the tree to grow to.
- ------------------------------------*/
- #define MAX_DEPTH 512
-
-
- /* ------------------------------------
- Define the maximum number of samples
- that can contribute to a pixel value
- ------------------------------------*/
- #define MAX_SAMPLES 10000
-
-
- /* -----------------------------------
- a node is a leaf node if it is null or
- both its children are null
- ------------------------------------*/
-
- #define IsLeaf(LNODE) ((LNODE == NULL) || \
- ((LNODE->Left == NULL) && (LNODE->Right == NULL)) \
- ? 1 : 0)
-
-
- /*------------------------------------
- a node is an internal node if its is
- not a leaf node
- ----------------------------------*/
-
- #define IsInternal(INODE) ( ( IsLeaf(INODE) ) ? 0 : 1)
-
-
- /*------------------------------------
- a node is a leaf parent if it is not a
- leaf but one of its child nodes is
- ----------------------------------*/
- #define IsLeafParent(INODE) \
- ((!IsLeaf(INODE)) && ( (IsLeaf(INODE->Right)) || (IsLeaf(INODE->Left)) ))
-
-
- /*---------------------------------
- choose a subnode to refine
- --------------------------------*/
- #define ChooseSubNode(NODE) ((NODE->Direction == GOLEFT) ? NODE->Left : NODE->Right)
-
-
- /*---------------------------------
- choose the other node
- --------------------------------*/
- #define ChooseOtherNode(PARENT,ONODE) (PARENT->Left == ONODE) \
- ? PARENT->Right : PARENT->Left
-
-
- #define fabs(a) ( ((a) > 0) ? (a) : -(a) )
- #define min(a,b) ( ((a) < (b)) ? a : b )
- #define max(a,b) ( ((a) < (b)) ? b : a )
-
-
- /*****************************************************************************
- the structure of a node in the hierachical tree
- ****************************************************************************/
- typedef struct Rectangle {
- float xL, xH, yL, yH;
- } RectType;
-
- typedef struct { float r,g,b,a; } FloatColor;
-
- typedef struct {
- float Xs, Ys;
- FloatColor Ave;
- } SampleData;
-
-
- typedef struct hierarchical_region HierarchicalRegion;
- struct hierarchical_region {
- HierarchicalRegion *Left; /* left child */
- HierarchicalRegion *Right; /* right child */
- SampleData *Sample; /* Sample value */
- float splitValue;
- unsigned splitDirection : 1; /* split direction: 0 Vertical; 1 Horizontal */
- };
-
-
-
- /*
- * Enumeration type for the filter kernel function type
- */
- typedef enum { Gaussian, Sinc, WindowedSinc, Cubic } FilterFunctionType;
-